package com.yufubao.service.service.applet.product;

import com.baomidou.mybatisplus.extension.service.IService;
import com.yufubao.framework.result.PageUtils;
import com.yufubao.model.dto.applet.product.SpuQueryPageDetailDto;
import com.yufubao.model.dto.applet.product.spu.SpuSaveDto;
import com.yufubao.model.pojo.applet.product.SpuInfoEntity;
import com.yufubao.model.pojo.applet.product.SupplierInfoEntity;
import com.yufubao.model.pojo.applet.elasticsearch.SupplierEsModel;

import java.util.List;
import java.util.Map;

/**
 * spu信息
 *
 * @author zhangzhan
 * @email 52194440@qq.com
 * @date 2024-08-29 16:01:46
 */
public interface SpuInfoService extends IService<SpuInfoEntity> {

    PageUtils queryPage(Map<String, Object> params);

    /**
     * @description 商家发布商品
     * @param dto
     * @return void
     * @author zhangyiheng
     * @date 2024/8/29 16:18
     */
    void saveDetail(SpuSaveDto dto);

    /**
     * @description 查询当前商店的spu信息
     * @param dto
     * @return com.yufubao.framework.result.PageUtils
     * @author zhangyiheng
     * @date 2024/8/30 10:07
     */
    PageUtils queryPageDetail(SpuQueryPageDetailDto dto);

    /**
     * @description 商品上架
     * @param spuId
     * @return void
     * @author zhangyiheng
     * @date 2024/9/1 15:40
     */
    void up(Long spuId);


    /**
     * @description 商户基本信息构建
     * @param supplierInfoId
     * @param supplierInfo
     * @param attrs
     * @return com.yufubao.model.pojo.elasticsearch.SupplierEsModel
     * @author zhangyiheng
     * @date 2024/9/3 23:14
     */
    public SupplierEsModel firstEs(Long supplierInfoId, SupplierInfoEntity supplierInfo, List<SupplierEsModel.Attrs> attrs);


    /**
     * @description 保存es商户信息
     * @param supplierEsModel
     * @return void
     * @author zhangyiheng
     * @date 2024/9/3 23:18
     */
    public void saveSupplierToSearch(SupplierEsModel supplierEsModel);
}

